angular.module('${menuCode}')
.filter('to_trusted', ['$sce', function ($sce) {
	return function (text) {
	    return $sce.trustAsHtml(text);
	};
}])
.controller("${widgetCode}Ctrl",function($scope,AppKit,$stateParams,$filter){
	$scope.loadContactsData = function() {
		$scope.piName=$stateParams.piName;
		var url='/aeaipm/services/ProjPlan/rest/find-plan-infos/'+$stateParams.piId;
		var promise = AppKit.getJsonApi(url);  
		promise.success(function(rspJson){
			$scope.projectPlan=rspJson.projectPlan;
			var count=0;
			for(var o in $scope.projectPlan){ 
		        if($scope.projectPlan[o].level==2){
		        	count++;
		        } 
		    }  
			$scope.count=count;
		}); 
	}
	$scope.loadContactsData();
});
 
